<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\common\validate;

/**
 * 会员验证器
 */
class ActivityDetail extends ValidateBase
{
    
    // 验证规则
    protected $rule = [
        'activity_type'  => 'require',
        'intro'          => 'require',
        'pcount'         => 'number',
        'gcount'         => 'number', 
        'fcount'         => 'number',
        'attitude'       => 'require',
        'capacity'       => 'require',
        'quality'        => 'require',
        'efficiency'     => 'require',
        'discipline'     => 'require',
    ];

    // 验证提示
    protected $message = [
        'activity_type.require'    => '请选择活动类型',
        'intro.require'            => '请输入活动介绍',
        'pcount.number'            => '参与人数请输入数字',
        'gcount.number'            => '发放宣传品数量请输入数字',
        'fcount.number'            => '问卷数量请输入数字',
        'attitude.number'          => '请对活动服务态度进行评价',
        'capacity.number'          => '请对活动服务能力进行评价',
        'quality.number'           => '请对活动服务质量进行评价',
        'efficiency.number'        => '请对活动服务效率进行评价',
        'discipline.number'        => '请对活动服务效果进行评价',
    ];

    // 应用场景
    protected $scene = [
        'add'   =>  ['activity_type','intro','pcount','gcount','fcount','attitude','capacity','quality','efficiency','discipline'],
        'edit'  =>  ['activity_type','intro',],
    ];
}
